<?php 
	session_start();
	$_SESSION['check']='';
		include_once 'DB/DBConfig.php';
		include_once 'DB/HouseDAO.php';
		include_once 'DB/House.php';
	function check_email($email) {
		if (strlen($email) == 0) 
			return false;
		if (preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/", $email))
			return true;
		return false;
	}
	if (isset($_POST['get_email'])){
		$email = $_POST['email'];
		$_SESSION['email']=$email;
		$houseDAO = new houseDAO();
		$house = $houseDAO->getByemail($email);
		if(check_email($email)){
			$_SESSION['check']= 'checkout';
			if ($house ==null)
			{header('Location: colonia.php');
			}
			else
			{
			if ($house[0]['id']==1){
				header('Location: colonia.php');
			}else if($house[0]['id']==2){
				header('Location: contemporary.php');
			}else if ($house[0]['id']==3){
				header('Location: urban.php');
			}
			}
			}
		else
		{
			$statusEmail = false;
		}
	}
?>
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!-- Consider adding a manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->

<head>
<meta charset="utf-8">

<!-- Use the .htaccess and remove these lines to avoid edge case issues.
       More info: h5bp.com/i/378 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">

<!-- Mobile viewport optimized: h5bp.com/viewport -->
<meta name="viewport" content="width=device-width">

<!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons -->

<link rel="stylesheet" href="css/style.css">

<!-- More ideas for your <head> here: h5bp.com/d/head-Tips -->

<!-- All JavaScript at the bottom, except this Modernizr build.
       Modernizr enables HTML5 elements & feature detects for optimal performance.
       Create your own custom Modernizr build: www.modernizr.com/download/ -->
<script src="js/libs/modernizr-2.5.3.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/themes/default/default.css">
<link rel="stylesheet" type="text/css" href="css/nivo-slider.css">
<script type="text/javascript" src="js/libs/jquery-1.7.1.js"></script>
<script type="text/javascript" src="js/libs/jquery.nivo.slider.js"></script>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script type="text/javascript">
    $(window).load(function() {
        $('#slider').nivoSlider();
    });
</script>
</head>
<body>
<!-- Prompt IE 6 users to install Chrome Frame. Remove this if you support IE 6.
       chromium.org/developers/how-tos/chrome-frame-getting-started --> 
<!--[if lt IE 7]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->
<header id="header">
  <div class="wrapper">
    <aside>
      <h3 id="topPhone">131 751</h3>
      <a href="#" class="freecall">Free Call Back Service</a> </aside>
    <section>
      <h1><a href="#">Home Buyers Centre</a></h1>
    </section>
    <div class="location">
    	<p>Your location: </p>
        <a class="wa" href="#"><img src="img/btn_wa.jpg" width="32" height="32"></a>
        <a class="wic" href="#"><img src="img/btn_wc.png" width="32" height="32"></a>
    </div>
    <div class="bg_hd"></div>
    <div class="nav">
    	<p>Stay Updated with Homebuyers Centre</p>
        <input class="name" type="text" placeholder="Name">
        <input class="email" type="text" placeholder="Email">
		<input type="image" src="img/btn_input.png" name="btn_login">
        <div class="bg_hd_1"></div>
        <input class="search" type="text" placeholder="Search">
        <input type="image" src="img/btn_input.png" name="btn_search">
    </div>
    <menu id="top_menu">
      <ul>
        <li class="first active"><a href="#">Home Designs</a></li>
        <li><a href="#">Finance</a></li>
        <li><a href="#">Home & Land</a></li>
        <li><a href="#">Latest Offers</a></li>
        <li><a href="#">Why Us ?</a></li>
        <li class="last"><a href="#">Contact Us</a></li>
      </ul>
    </menu>
  </div>
</header>
<div role="main" id="main">
  <div class="wrapper page_intro">
  		<h2>Home Colour Selector</h2>
        <p class="content_color_select">Visualise our designs in the colours that suit you. Select your preferred elevation type then ues the controls below to select colour options for each component of the home <br /> exterior. Once happy with your look, click the save button to have blah, blah, blah.</p>
        <section>
            <form action="" method="POST">
	            <label>Please enter your email address:</label>
            	<input name="email" type="text" size="40" placeholder="Email Address">
                <input name="get_email" type="submit" value="GO">
            </form>
			<?php if((isset($_GET['login'])) && ($_GET['login'] == "false" )): ?>
				<p class="error_before">Please input email before go to main site</p>
			<?php endif; ?>
			
			<?php if(isset($statusEmail) && $statusEmail == false): ?>
				<p class="error">Please enter a valid email address</p>
			<?php endif; ?>
        </section>
        <div class="slider-wrapper theme-default">
            <div id="slider" class="nivoSlider">
                <a href="#"><img src="img/1.png" width="700" height="374"></a>
                <a href="#"><img src="img/2.png" width="700" height="372"></a>
               	<a href="#"><img src="img/3.png" width="700" height="374"></a>
            </div>   
        </div>
  </div>
</div>
<footer id="footer">
	<div class="footer_top">
    	<p class="remember">Remember, It's only takes three easy steps:</p>
        <div class="menu_top">
        	<div class="finance top">
            	<span>1</span>
                <div class="content">
                	<p class="title">Finance</p>
                    <p class="content_1">At Homebuyers Centre, we've <br />made financing your dream ...</p>
                </div>
            </div>
            <div class="land top">
            	<span>2</span>
                <div class="content">
                	<p class="title">Land</p>
                    <p class="content_1">Over the years, we'vedevel- <br />oped great relationships...</p>
                </div>
            </div>
            <div class="home top">
            	<span>3</span>
                <div class="content">
                	<p class="title">Home</p>
                    <p class="content_1">Our talented team of design- <br />ers are constantly...</p>
                </div>
            </div>
        </div>
    </div>
    <div class="footer_bottom">
    	<div class="logo_bottom">
        	<h1><a href="#">Homebuyers Center</a></h1>
            <div class="add_this">
            	<!-- AddThis Button BEGIN -->
                <div class="addthis_toolbox addthis_default_style ">
                <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
                <a class="addthis_button_tweet"></a>
                <a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
                <a class="addthis_counter addthis_pill_style"></a>
                </div>
                <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4fbc97a833da0ce7"></script>
				<!-- AddThis Button END -->
            </div>
        </div>
        <p class="copy_right">Copyright 2012 Homebuyers Centre. All Rights Reserverd.</p>
        <div class="menu_bottom">
        	<ul>
            	<li class="first"><a href="#">Home Designs</a></li>
                <li><a href="#">Home finder</a></li>
                <li><a href="#">Melbourne Homes</a></li>
                <li><a href="#">Perth Homes</a></li>
                <li><a href="#">Primo Collection</a></li>
                <li><a href="#">5m Designs</a></li>
                <li><a href="#">Ultimate Series</a></li>
                <li><a href="#">Rewards Program</a></li>
                <li><a href="#">3 Easy Steps</a></li>
            </ul>
            <ul>
            	<li class="first"><a href="#">Finance</a></li>
                <li><a href="#">Home Loans</a></li>
                <li><a href="#">Finance Help</a></li>
                <li><a href="#">Grants</a></li>
                <li><a href="#">Keystart Government</a></li>
                <li><a href="#">Assisted Finance</a></li>
                <li><a href="#">Stamp Duty</a></li>
                <li><a href="#">Rewards Program</a></li>
            </ul>
            <ul>
            	<li class="first"><a href="#">Home & Land</a></li>
                <li><a href="#">Latest Packages</a></li>
                <li><a href="#">Land Options</a></li>
                <li><a href="#">Investment Packages</a></li>
                <li><a href="#">Currambine Packages</a></li>
            </ul>
            <ul>
            	<li class="first"><a href="#">Latest Offers</a></li>
                <li><a href="#">Newsletter Signup</a></li>
                <li><a href="#">3 Easy steps</a></li>
                <li><a href="#">Package Specials</a></li>
            </ul>
            <ul>
            	<li class="first"><a href="#">Homebuyers Centre</a></li>
                <li><a href="#">History</a></li>
                <li><a href="#">Management Team</a></li>
                <li><a href="#">Testimonials</a></li>
                <li><a href="#">Construction Process</a></li>
                <li><a href="#">6 Point Quality Guarantee</a></li>
                <li><a href="#">Value For Money</a></li>
            </ul>
            <ul>
            	<li class="first"><a href="#">Contact Us</a></li>
                <li><a href="#">Contact Us</a></li>
                <li><a href="#">About Us</a></li>
                <li><a href="#">Privacy Policy</a></li>
            </ul>
        </div>
    </div>
    
  <!--<div class="wrapper">
    <h3>Copyright 2010 Homebuyers Centre&trade;</h3>
    <menu>
      <ul>
        <li><a href="#">Site Map</a><span>|</span></li>
        <li><a href="#">Privacy Policy</a><span>|</span></li>
        <li><a href="#">Contact Us</a><span>|</span></li>
        <li><a href="#">Terms and Conditions</a></li>
      </ul>
    </menu>
    <aside>Netstarter - <a target="_blank" title="search engine optimisation sydney" href="http://www.netstarter.com.au/services/seo">SEO</a>, <a target="_blank" title="search marketing agency" href="http://www.netstarter.com.au/services/sem">Search Marketing</a> &amp; <a target="_blank" title="social media agency" href="http://www.netstarter.com.au/services/social-media">Social Media</a> </span> </aside>
  </div>-->
</footer>
</body>
</html>